FROM node:16.14.0-alpine3.15 AS download_deps
WORKDIR /download
COPY package.json yarn.lock ./
RUN yarn

FROM node:16.14.0-alpine3.15 AS build
WORKDIR /build
COPY . /build/
COPY --from=download_deps /download/node_modules /build/node_modules/
RUN yarn run build

FROM nginx:stable-alpine
COPY --from=build /build/dist /usr/share/nginx/html/

# docker build \
#     --build-arg HTTP_PROXY="http://172.16.5.115:8580" \
#     --build-arg HTTPS_PROXY="http://172.16.5.115:8580"  \
#     -t my_http_service:latest \
#     -f Dockerfile .
#
# docker run -itd --rm -p 8080:80 my_http_service:latest
